package com.yhn.init.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yhn.init.common.DeleteRequest;
import com.yhn.init.model.dto.approvals.ApprovalsAddRequest;
import com.yhn.init.model.dto.approvals.ApprovalsPurchaseRequest;
import com.yhn.init.model.dto.approvals.ApprovalsQueryRequest;
import com.yhn.init.model.dto.approvals.ApprovalsRequest;
import com.yhn.init.model.entity.Approvals;
import com.yhn.init.model.vo.ApprovalsVO;

import java.util.List;

/**
 * 审批信息
 *
 * @author yhnyhn123
 * @email 2236751002@qq.com
 * @date 2024-03-08 20:36:42
 */
public interface ApprovalsService extends IService<Approvals> {

    Page<ApprovalsVO> queryPage(ApprovalsQueryRequest approvalsQueryRequest);

    /**
     * 获取查询条件(分页)
     *
     * @param approvalsQueryRequest
     * @return
     */
    QueryWrapper<Approvals> getQueryWrapper(ApprovalsQueryRequest approvalsQueryRequest);

    /**
     * 将对象转化为脱敏对象
     *
     * @param approvals 原对象
     * @return 脱敏对象
     */
    ApprovalsVO getApprovalsVO(Approvals approvals);

    /**
     * 获取脱敏对象集合
     *
     * @param approvalsList 原对象
     * @return 脱敏对象集合
     */
    List<ApprovalsVO> getApprovalsVO(List<Approvals> approvalsList);


    /**
     * 根据ID获取信息
     *
     * @param id ID信息
     * @return 实体信息
     */
    ApprovalsVO getInfoById(Long id);

    /**
     * 保存信息
     *
     * @param approvalsAddRequest 添加请求
     * @return 新生成的ID
     */
    Long saveApprovals(ApprovalsAddRequest approvalsAddRequest);

    /**
     * 修改信息
     *
     * @param approvalsUpdateRequest 修改请求
     * @return 是否修改成功
     */
    Boolean updateApprovals(ApprovalsRequest approvalsUpdateRequest);


    /**
     * 删除信息
     *
     * @param deleteRequest 删除请求
     * @return 是否修改成功
     */
    Boolean deleteById(DeleteRequest deleteRequest);


    /**
     * 批量删除
     *
     * @param ids 批量删除的IDS
     * @return 是否删除成功
     */
    Boolean deleteBatchByIds(Long[] ids);

    /**
     * 审批订单
     *
     * @param approveRequest 订单审批请求
     * @return 审核是否通过
     */
    Boolean approvals(ApprovalsRequest approveRequest);

    /**
     * 审批采购请求
     *
     * @param approvalsPurchaseRequest 采购清单审批请求
     * @return 审核是否通过
     */
    Boolean approvalPurchase(ApprovalsPurchaseRequest approvalsPurchaseRequest);
}

